<template>
	<view class="padding-sm">
		<template>
			<div>
				<u-parse :content="article"></u-parse>
			</div>
		</template>
	</view>
</template>

<script>
	import uParse from '@/components/u-parse/u-parse.vue'
	export default {
		components: {
			uParse
		},
		data() {
			return {
				article:'',
			}
		},
		onLoad(options) {
			var state = options.state;
			let title = "";
			if(state == "0"){
				title = "管理规则";
			}else if(state == "1"){
				title = "会员协议";
			}
			uni.setNavigationBarTitle({
				title
			})
			this.article = title;
			var that = this;
			that.$network.nonAuthRequest("InitAction/getRuleByState", {state : state}, function(res) {
				that.article = res.data.rule.ruleDetail.replace(new RegExp("/fxsc/", "gm"), that.$host);
			}, "", function(res) {
				console.error(JSON.stringify(res))
				uni.showToast({
					icon: 'none',
					title: '加载失败',
					duration: 1200
				})
			});
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
